﻿<%@ include file="../include/top.jsp"%>
<%@ include file="../include/errorArea.jsp" %>
<link rel="stylesheet" href="${baseURL}/css/zTreeStyle/zTreeStyle.css" type="text/css">
<script language="javascript" type="text/javascript" src="${baseURL}/js/jquery.ztree.all-3.5.min.js">
</script>
<script  type="text/javascript" src="${baseURL}/js/jquery.validate.js"></script>
<script  type="text/javascript" src="${baseURL}/js/jquery-1.8.3.js"></script>
<script type="text/javascript" src="${baseURL}/js/LodopFuncs.js"></script>
<SCRIPT type="text/javascript">
var LODOP;
function orderDeatilPrint(){
	var orderCode = $("#orderCode").val();
	$.get('${ctx}/printInfoAction/orderDetailPrint/'+orderCode,function(data, textStatus) {
		if(textStatus == 'success') {
			LODOP=getLodop(document.getElementById('LODOP_OB'),document.getElementById('LODOP_EM'));  
			//var strStyleCSS="<link href='${ctx}/css/PrintSample10.css' type='text/css' rel='stylesheet'>";
			//var strFormHtml=strStyleCSS+"<table>"+document.getElementById("aa").innerHTML+"</table>";
			//LODOP.ADD_PRINT_TEXT(50,231,260,39,"");
			LODOP.SET_PRINT_PAGESIZE(3,1400,200,"");
			LODOP.SET_PRINT_STYLE("FontSize",18);
			LODOP.SET_PRINT_STYLE("Bold",1);
			LODOP.ADD_PRINT_TEXT(0,0,0,0,"");
			LODOP.ADD_PRINT_HTM(0,0,480,600,data);
			LODOP.PREVIEW();
			//LODOP.ADD_PRINT_URL(5,5,"100%","100%","listDy");
		}
	});
}
	/* var setting = {
		view: {
			dblClickExpand: false
		},
		data: {
			simpleData: {
				enable: true
			}
		},
		callback: {
			onClick: onClick
		}
	};

	var zNodes = ${treedata}; //后台返回的数据

	function onClick(e,treeId, treeNode) {
		var zTree = $.fn.zTree.getZTreeObj("treeDemo");
		zTree.expandNode(treeNode);

		//叶节点，并且不是第一层节点(第一层节点的pId是null)
		//if(!treeNode.isParent && treeNode.pId!=null){
			nodes = zTree.getSelectedNodes();
			$("#selectedNodeName").attr("value", treeNode.name);
			$("#nodeId").attr("value", treeNode.id);
		//}
	}

	function onBodyDown(event) {
		if (!(event.target.id == "menuBtn" || event.target.id == "selectedNodeName" || event.target.id == "menuContent" || $(event.target).parents("#menuContent").length>0)) {
			hideMenu();
		}
	}

	$(document).ready(function(){
		$.fn.zTree.init($("#treeDemo"), setting, zNodes);
		
		var treeObj = $.fn.zTree.getZTreeObj("treeDemo");
		var nodes = treeObj.getNodesByParam("id", "${formdata.nodeId}", null);
		if (nodes.length>0) {
			treeObj.selectNode(nodes[0]);
		}

	}); */
	
	
</SCRIPT>
<object id="LODOP_OB" classid="" width=0 height=0> 
    <embed id="LODOP_EM" type="application/x-print-lodop" width=0 height=0></embed>
</object>
<div id="printArea">
<input type="hidden" id="orderCode" value="${orderCode}">
<c:if test="${not empty obj.list}">

<table width="98%" border="0" align="center" cellpadding="0" cellspacing="1" id="listOutTable">
  <tr>
    <td colspan="2" align="left" valign="middle" class="text_gray2"><table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#96bee2">
     <tr>
        <td height="13" valign="top" bgcolor="#FFFFFF">
      
	<c:forEach var="row" items="${obj.list}">  
                   <div class="s-order-box">
                     <div class="text_left bg">
                             <br/>
                        		订单号：${row.orderCode}
                        		<br/>
                        		下单时间 : <fmt:formatDate value="${row.createTime}" pattern="yyyy-MM-dd HH:mm:ss"/>   
                        		 <br/>
                        		配送地址：${row.address} 
                        </div>
                        <br/>
                         <div class="text_left bg">
                        <table cellpadding="0" cellspacing="0"  width="90%">
                        <tbody>
                           <tr>
                        <td class="no_padding"  width="50%">
                         商品名称 </td>
                          <td class="no_padding" width="15%">
                         订购数量 </td>
                          <td class="no_padding" width="15%">
                         单价 </td>
                         <td class="no_padding" width="20%">
                         小计 </td></tr>
                            	<c:forEach var="product" items="${row.osvList}">  
                        <tr>
                        <td class="no_padding">
                       ${product.productName}-${product.productFieldValue} </td>
                          <td class="no_padding">
                      ${product.productCount} </td>
                          <td class="no_padding">
                       ${product.sellPrice} </td>
                         <td class="no_padding">
                          ${product.sellPrice*product.productCount} </td>
                      
                        </tr>
                         <tr>
                                  <td colspan="3" align="right">合计:</td>
                                  <td>${total}</td>
                                  </tr>
                        <c:if test="${not empty product.sug}">
                        <tr>
                        <td colspan="4">
                        <div class="section-right-order">
			<div class="my-order">
				<div class="my-order-left">验光单</div>
				<div class="my-order-right">&nbsp;</div>
			</div>

			<div class="order-list">
				<br />
				<table cellpadding="0" cellspacing="0" class="order-list-table">
					<tr>
						<th>RX</th>
						<th>&nbsp;</th>
						<th>球镜SPH</th>
						<th>柱镜CYL</th>
						<th>轴位AXLS</th>
						<th>瞳距</th>
						<th>备注</th>
					</tr>
					<tr>
						<td rowspan="2">
							<label><c:if test="${product.sug.eyeType=='Short'}">近视</c:if></label><br/> 
							<label><c:if test="${product.sug.eyeType=='Long'}">远视</c:if></label><br/> 
						</td>
						<td>右眼R</td>
						<td>${product.sug.sphRight}</td>
						<td>${product.sug.cylRight}</td>
						<td>${product.sug.axlsRight}</td>
						<td rowspan="2">${product.sug.distance}</td>
						<td rowspan="2">${product.sug.remarks}</td>
					</tr>
					<tr>
						<td>左眼L</td>
						<td>${product.sug.sphLeft}</td>
						<td>${product.sug.cylLeft}</td>
						<td>${product.sug.axlsLeft}</td>
					</tr>
				</table>
			</div>
		</div>
                        </td>
                        </tr>
                        </c:if>
                                </c:forEach>  
                                 
                        </tbody></table>
                        </div>
                      </div>
                </c:forEach>
        
        </td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td height="1" colspan="2" align="center" bgcolor="#A6CAE8">
    	<button id="print_button" onclick="orderDeatilPrint();">打印</button>
   		<!-- <input type="button"  id="print_button" value="打印" onclick="orderDeatilPrint();" /> -->
    </td>
  </tr>
  <tr>
    <td height="1" colspan="2" bgcolor="#A6CAE8"></td>
  </tr>
</table>
<script src="${ctx}/js/listProduct.js"></script>
</c:if>
</div>
<%@ include file="../include/bottom.jsp"%>